package work9Y7D;

import java.util.Arrays;

public class HomeWork03 {
	public static void main(String[] args) {
		int[] arr = {7,4,2,2,5,8,7,8,10};
		int t = 0;
        int[] tempArr = new int[arr.length];
        for(int i = 0; i < arr.length; i++){
            boolean isTrue = true;
            for(int j=i+1;j<arr.length;j++){
                if(arr[i]==arr[j]){
                    isTrue = false;
                    break;
                }
            }
            if(isTrue){
                tempArr[t] = arr[i];
                t++;
            }
        }
        int[]  newArr = new int[t];
        System.arraycopy(tempArr,0,newArr,0,t);
        System.out.println(Arrays.toString(newArr));
	}
}
